using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace UTLBASEFORM
{
    public partial class ControlShow : UserControl
    {
        #region "Private Filed"
        private string _luong;
        private string _chi;
        private string _phan;
        private string _li;
        private string _phanle;
        #endregion

        public ControlShow()
        {
            InitializeComponent();
        }
        public string Luong
        {
            get { return lblLuong.Text.Trim(); }
            set { lblLuong.Text=value;}
        }
        public string Chi
        {
            get { return lblChi.Text.Trim(); }
            set { lblChi.Text=value;}
        }
        public string Phan
        {
            get { return lblPhan.Text.Trim(); }
            set { lblPhan.Text = value; }
        }
        public string Li
        {
            get { return lblLi.Text.Trim(); }
            set { lblLi.Text = value; }
        }
        public string PhanLe
        {
            get { return lblPhanLe.Text; }
            set { lblPhanLe.Text = value; }
        }


        public string getValue
        {
            get
            {
                string strResult = "";
                string _luong = "0";
                string _chi = "0";
                string _phan = "0";
                string _li = "0";
                if (!lblLuong.Text.Trim().Equals(""))
                {
                    _luong = lblLuong.Text;
                }
                if (!lblChi.Text.Trim().Equals(""))
                {
                    _chi = lblChi.Text;
                }
                if (!lblPhan.Text.Trim().Equals(""))
                {
                    _phan = lblPhan.Text;
                }
                if (!lblLi.Text.Trim().Equals(""))
                {
                    _li = lblLi.Text;
                }
                strResult = _luong + ";" + _chi + ";" + _phan + ";" + _li;
                return strResult;
            }



        }

        private void ControlShow_Load(object sender, EventArgs e)
        {
            _luong = "";
            _chi="";
            _phan = "";
            _li="";
            _phanle = "";

            lblLuong.Text = "";
            lblPhan.Text = "";
            lblChi.Text = "";
            lblLi.Text = "";
            lblPhanLe.Text = "";
        }

        private void lblLuong_TextChanged(object sender, EventArgs e)
        {
            if (lblLuong.Text.Equals("") || lblLuong.Text.Equals("0"))
            {
                lbLuong.Text = "";
            }
            else
            {
                lbLuong.Text = "L";
            }
        }

        private void lblChi_TextChanged(object sender, EventArgs e)
        {
            if (lblChi.Text.Equals("") || lblChi.Text.Equals("0"))
            {
                lbChi.Text = "";
            }
            else
            {
                lbChi.Text = "C";
            }
        }

        private void lblPhan_TextChanged(object sender, EventArgs e)
        {
            if(lblPhan.Text.Equals("")||lblPhan.Text.Equals("0"))
            {
                lbPhan.Text="";
            }
            else
            {
                lbPhan.Text="P";
            }
        }

        private void lblLi_TextChanged(object sender, EventArgs e)
        {
            if (lblLi.Text.Equals("") || lblLi.Text.Equals("0"))
            {
                lbLi.Text = "";
            }
            else
            {
                lbLi.Text = "L";
            }
        }

        private void lblPhanLe_TextChanged(object sender, EventArgs e)
        {
            
        }
    }
}
